﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

// T.R.A.C.
// Main Author(s): Morgan Davis
// Additional Authors:
// Date: 10/20/2013

namespace TRAC_Demo
{
    public partial class FormIssueTree : Form
    {
        #region [ Fields ]

        public string returnIssue{get{return treeIssue.SelectedNode.Text;}} //used to return selected value to calling form

        #endregion

        #region [ Constructors ]

        public FormIssueTree()
        {
            InitializeComponent();
            this.BackColor = CurrentUser.UserColor;
        }

        #endregion

        #region [ Events ]

        private void btnCancel_Click(object sender, EventArgs e) //close the form with a return of 'CANCEL'
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            if (this.treeIssue.SelectedNode != null) //do not allow return of 'OK' if user has not made a selection
                this.DialogResult = DialogResult.OK;
            else
                this.DialogResult = DialogResult.Cancel;
        }

        #endregion
    }
}
